import request from '@/config/axios'
import { TestVO } from '../test'
// 试卷试题 VO
export interface PaperTestVO {
  id: number // ID
  paperid: string // 试卷ID
  testid: number // 试题ID
  testType: number // 题型类型
}
export interface PaperTestListVO {
  paperid: string // 试卷ID
  testList: TestVO[] // 试题ID数组
}
// 试卷试题 API
export const PaperTestApi = {
  // 查询试卷试题分页
  getPaperTestPage: async (params: any) => {
    return await request.get({ url: `/exam/paper-test/page`, params })
  },

  // 查询试卷试题详情
  getPaperTest: async (id: number) => {
    return await request.get({ url: `/exam/paper-test/get?id=` + id })
  },

  // 新增试卷试题
  createPaperTest: async (data: PaperTestVO) => {
    return await request.post({ url: `/exam/paper-test/create`, data })
  },

  // 修改试卷试题
  updatePaperTest: async (data: PaperTestVO) => {
    return await request.put({ url: `/exam/paper-test/update`, data })
  },

  // 删除试卷试题
  deletePaperTest: async (id: number) => {
    return await request.delete({ url: `/exam/paper-test/delete?id=` + id })
  },

  // 导出试卷试题 Excel
  exportPaperTest: async (params) => {
    return await request.download({ url: `/exam/paper-test/export-excel`, params })
  },
   // 新增试卷试题
   createPaperTestList: async (data: PaperTestListVO) => {
    return await request.post({ url: `/exam/paper-test/createlist`, data })
  },
}